package com.jiezheng.huinong.dao;

import java.util.HashMap;
import java.util.List;

import org.apache.ibatis.session.SqlSession;

import com.jiezheng.huinong.db.conf.ICommonIndexDAO;
import com.jiezheng.huinong.util.DbUtil;

public class CommonIndexDAOImpl  implements ICommonIndexDAO {

	@Override
	public List<HashMap<String, String>> listIndexNo() {
		SqlSession session = DbUtil.getSqlSessionFactory().openSession();
		List<HashMap<String, String>> data = null;

		try {
			data = session.selectList(
					"com.jiezheng.huinong.commonIndex.listIndexNo");
		} catch (Exception e) {
			e.printStackTrace();
		} finally {
			session.close();
		}
		return data;
	}

	@Override
	public List<HashMap<String, String>> listPaperDate() {
		SqlSession session = DbUtil.getSqlSessionFactory().openSession();
		List<HashMap<String, String>> data = null;

		try {
			data = session.selectList(
					"com.jiezheng.huinong.commonIndex.listPaperDate");
		} catch (Exception e) {
			e.printStackTrace();
		} finally {
			session.close();
		}
		return data;
		
	}

	@Override
	public List<HashMap<String, String>> listBudgetUnit() {
		SqlSession session = DbUtil.getSqlSessionFactory().openSession();
		List<HashMap<String, String>> data = null;

		try {
			data = session.selectList(
					"com.jiezheng.huinong.commonIndex.listBudgetUnit");
		} catch (Exception e) {
			e.printStackTrace();
		} finally {
			session.close();
		}
		return data;
	}

	@Override
	public List<HashMap<String, String>> listIndexSource() {
		SqlSession session = DbUtil.getSqlSessionFactory().openSession();
		List<HashMap<String, String>> data = null;

		try {
			data = session.selectList(
					"com.jiezheng.huinong.commonIndex.listIndexSource");
		} catch (Exception e) {
			e.printStackTrace();
		} finally {
			session.close();
		}
		return data;
	}

	@Override
	public List<HashMap<String, String>> listIndexType() {
		SqlSession session = DbUtil.getSqlSessionFactory().openSession();
		List<HashMap<String, String>> data = null;

		try {
			data = session.selectList(
					"com.jiezheng.huinong.commonIndex.listIndexType");
		} catch (Exception e) {
			e.printStackTrace();
		} finally {
			session.close();
		}
		return data;
	}

	@Override
	public List<HashMap<String, String>> listFundProp() {
		SqlSession session = DbUtil.getSqlSessionFactory().openSession();
		List<HashMap<String, String>> data = null;

		try {
			data = session.selectList(
					"com.jiezheng.huinong.commonIndex.listFundProp");
		} catch (Exception e) {
			e.printStackTrace();
		} finally {
			session.close();
		}
		return data;
	}

	@Override
	public List<HashMap<String, String>> listPayMethod() {
		SqlSession session = DbUtil.getSqlSessionFactory().openSession();
		List<HashMap<String, String>> data = null;

		try {
			data = session.selectList(
					"com.jiezheng.huinong.commonIndex.listPayMethod");
		} catch (Exception e) {
			e.printStackTrace();
		} finally {
			session.close();
		}
		return data;
	}

	@Override
	public List<HashMap<String, String>> listBudgetItem() {
		SqlSession session = DbUtil.getSqlSessionFactory().openSession();
		List<HashMap<String, String>> data = null;

		try {
			data = session.selectList(
					"com.jiezheng.huinong.commonIndex.listBudgetItem");
		} catch (Exception e) {
			e.printStackTrace();
		} finally {
			session.close();
		}
		return data;
	}

	@Override
	public List<HashMap<String, String>> listFuncType() {
		SqlSession session = DbUtil.getSqlSessionFactory().openSession();
		List<HashMap<String, String>> data = null;

		try {
			data = session.selectList(
					"com.jiezheng.huinong.commonIndex.listFuncType");
		} catch (Exception e) {
			e.printStackTrace();
		} finally {
			session.close();
		}
		return data;
	}

	@Override
	public List<HashMap<String, String>> listFinancialType() {
		SqlSession session = DbUtil.getSqlSessionFactory().openSession();
		List<HashMap<String, String>> data = null;

		try {
			data = session.selectList(
					"com.jiezheng.huinong.commonIndex.listFinancialType");
		} catch (Exception e) {
			e.printStackTrace();
		} finally {
			session.close();
		}
		return data;
	}

}
